package com.yc.cloud.admin.vo;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;
import java.util.Map;

/**
 * 媒体流信息视图对象
 *
 * @author kinggu
 * @since 2025-01-03
 */
@Data
@ApiModel(value = "MediaStreamVo", description = "媒体流信息")
public class MediaStreamVo {

    @ApiModelProperty("应用名")
    private String app;

    @ApiModelProperty("本协议观看人数")
    @JsonProperty("readerCount")
    private Integer readerCount;

    @ApiModelProperty("观看总人数")
    @JsonProperty("totalReaderCount")
    private Integer totalReaderCount;

    @ApiModelProperty("协议")
    private String schema;

    @ApiModelProperty("流ID")
    private String stream;

    @ApiModelProperty("客户端和服务器网络信息")
    @JsonProperty("originSock")
    private Map<String, Object> originSock;

    @ApiModelProperty("产生源类型")
    @JsonProperty("originType")
    private Integer originType;

    @ApiModelProperty("产生源类型字符串")
    @JsonProperty("originTypeStr")
    private String originTypeStr;

    @ApiModelProperty("产生源的URL")
    @JsonProperty("originUrl")
    private String originUrl;

    @ApiModelProperty("GMT unix系统时间戳，单位秒")
    @JsonProperty("createStamp")
    private Long createStamp;

    @ApiModelProperty("存活时间，单位秒")
    @JsonProperty("aliveSecond")
    private Integer aliveSecond;

    @ApiModelProperty("数据产生速度，单位byte/s")
    @JsonProperty("bytesSpeed")
    private Long bytesSpeed;

    @ApiModelProperty("音视频轨道")
    private List<TrackInfo> tracks;

    @ApiModelProperty("音视频轨道数量")
    private Integer trackCount;

    @ApiModelProperty("音视频轨道JSON字符串")
    private String tracksJson;

    @ApiModelProperty("虚拟主机名")
    private String vhost;

    @Data
    @ApiModel(value = "TrackInfo", description = "音视频轨道信息")
    public static class TrackInfo {
        @ApiModelProperty("音频通道数")
        private Integer channels;

        @ApiModelProperty("编码ID")
        @JsonProperty("codec_id")
        private Integer codecId;

        @ApiModelProperty("编码类型名称")
        @JsonProperty("codec_id_name")
        private String codecIdName;

        @ApiModelProperty("编码类型：Video = 0, Audio = 1")
        @JsonProperty("codec_type")
        private Integer codecType;

        @ApiModelProperty("轨道是否准备就绪")
        private Boolean ready;

        @ApiModelProperty("累计接收帧数")
        private Long frames;

        @ApiModelProperty("音频采样位数")
        @JsonProperty("sample_bit")
        private Integer sampleBit;

        @ApiModelProperty("音频采样率")
        @JsonProperty("sample_rate")
        private Integer sampleRate;

        @ApiModelProperty("视频fps")
        private Integer fps;

        @ApiModelProperty("gop间隔时间，单位毫秒")
        @JsonProperty("gop_interval_ms")
        private Integer gopIntervalMs;

        @ApiModelProperty("gop大小，单位帧数")
        @JsonProperty("gop_size")
        private Integer gopSize;

        @ApiModelProperty("累计接收关键帧数")
        @JsonProperty("key_frames")
        private Long keyFrames;

        @ApiModelProperty("视频高度")
        private Integer height;

        @ApiModelProperty("视频宽度")
        private Integer width;
    }
}
